package com.designpattern.createpattern.demo04;

/**
 * @description:抽象工厂模式
 */
public class Main {
    private PizzaFactory factory;
    // 抽象工厂模式
    public static void main(String[] args) {
        Main main = new Main(new ApplePizzaFactory());
        main.orderPizza("small");
    }

    public Main(PizzaFactory factory){
        this.factory = factory;
    }

    public void orderPizza(String type){
        Pizza pizza = factory.createPizza(type);
        pizza.make();
    }
}
